import FetchHelper from "../helper/fetch-helper";
export default class FxqyApi {
    //行政区名称
    static async xzqmc_find() {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/yjsj/selectXzqhmc`)
        return resp
    }
    //根据隐患类型和行政区划分统计隐患
    static async count_yh(yhlb) {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/yjsj/groupByYhlx`, {
            yhlb: yhlb
        })
        return resp;
    }

    //根据隐患类型统计行政区划数量
    static async count_yh_xzqumc(yhlx) {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/yhsj/groupByXzqhmcByYhlx`, {
            yhlx: yhlx
        })
        return resp;
    }
    //根据隐患类型返回数据列表
    static async yhlx_find(bo) {
        let resp;
        //console.log('1')
        if (bo?.yhlx === '地震灾害') {
            //console.log('2')
            resp = FetchHelper.getJson(`/admin-api/ybyj/dizhenData/list`)
        }else if (bo?.yhlx === '地质灾害') {
           
            resp =    FetchHelper.getJson(`/admin-api/ybyj/yhsj/list`, {yhlb:bo?.yhlx})
           
          
        } else {
            //console.log('3')
            resp = FetchHelper.getJson(`/admin-api/ybyj/yhsj/list`, bo)
        }


        return resp
    }
    //隐患类型返回数据列表
    static async yhlx_find1() {
       
           const resp = FetchHelper.getJson(`/admin-api/ybyj/yhsj/list`)
     

        return resp
    }


    //根据id返回yh数据
    static async yhdjId(id) {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/yhsj/list`, { id: id })
        return resp
    }
    //根据id返回地震数据
    static async dzId(id) {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/dizhenData/list`,{id:id})
        return resp
    }

    //历年地震数据列表
    static async lndzsj_find(params) {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/dizhenData/list`, params)
        return resp
    }
    //按行政区统计数据
    static async count_find() {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/yhsj/selectXzqhmcCountYhlx`)
        return resp
    }
    //按隐患类型和空间返回数据
    static async wkt_find(wkt, yhlx) {
        const resp = FetchHelper.getJson(`/admin-api/ybyj/yhsj/selectByYhlxAndWkt`, { wkt: wkt, yhlx: yhlx })
        return resp
    }
}